package listbyorder.access101_200.test154;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/7/13 9:45
 */
public class Solution3 {

    // 一种递归的解法
    public int findMin(int[] nums) {
        return bs(nums, 0, nums.length - 1);
    }

    private int bs(int[] nums, int l, int r) {
        if (l == r) return nums[l];
        int mid = (l + r) >> 1;
        int left = bs(nums, l, mid);
        int right = bs(nums, mid + 1, r);
        return Math.min(left, right);
    }
}
